package com.dorm.mapper;

import com.dorm.entity.DisciplinaryRecord;
import org.apache.ibatis.annotations.*;
import java.util.List;

@Mapper
public interface DisciplinaryRecordMapper {
    @Select("SELECT * FROM disciplinary_records WHERE student_id = #{studentId}")
    List<DisciplinaryRecord> findByStudentId(Long studentId);

    @Insert("INSERT INTO disciplinary_records(student_id, description, record_time) " +
            "VALUES(#{studentId}, #{description}, #{recordTime})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int insert(DisciplinaryRecord record);

    @Delete("DELETE FROM disciplinary_records WHERE id = #{id}")
    int deleteById(Long id);
} 